package utility

import (
	"crypto/md5"
	"encoding/hex"
	"regexp"
)

func IsValidPhoneNumber(phoneNumber string) bool {
	pattern := `^1[3-9]\d{9}$`
	reg := regexp.MustCompile(pattern)
	return reg.MatchString(phoneNumber)
}

func MD5String(s string) string {
	h := md5.New()
	h.Write([]byte(s))
	return hex.EncodeToString(h.Sum(nil))
}
